#pragma once

#define DECLARE_TYPE_TEST(type) \
	namespace nef {\
	template<typename T> \
struct has_ ## type ## _test \
{ \
private:\
	template<typename U> \
	static char test_impl(...); \
	template<typename U> \
	static int test_impl(typename U::type *);\
	\
public: \
	static const bool value = sizeof(test_impl<T>(nullptr)) == sizeof(int); \
}; }

#define TYPE_TEST_N_TT(name, n) DECLARE_TYPE_TEST(name ## n)
#define TYPE_TEST_N_T(name, n) TYPE_TEST_N_TT(name, n)
#define TYPE_TEST_N(name, n) TYPE_TEST_N_T(name, n)